<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const obj = {}

      const arr = []

      let str = '123'
      let str1 = new String('123')

      let num = 123

      //1.typeof判断简单数据类型
      //   console.log(typeof str)
      //   console.log(typeof num)
      //   console.log(typeof null)

      //2.instanceof 判断左边的原型对象是不是右边的原型对象 左边.__proto__ === 右边.prototype
      //   console.log(obj instanceof Object)
      //   console.log(arr instanceof Array)
      //   console.log(str instanceof String)
      //   console.log(str1 instanceof String)

      //   console.log(str)
      //   console.log(str1)

      //   console.log(arr instanceof Object)

      //   let str1 = new String(str)

      //   console.log(str1.length)

      //   str1 = null

      //3.Object.prototyoe.toString.call(要判断的数据)

      console.log(Object.prototype.toString.call(arr) === '[object Array]')
      console.log(Object.prototype.toString.call(num) === '[object Number]')
    </script>
  </body>
</html>
